package com.qh.system.service.impl;

import com.qh.basic.service.impl.BaseServiceImpl;
import com.qh.system.domain.DictionaryType;
import com.qh.system.mapper.DictionaryDetailMapper;
import com.qh.system.service.DictionaryDetailService;
import com.qh.system.service.DictionaryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
/**
 * 业务实现类：数据字典类型
 */
public class DictionaryTypeServiceImpl extends BaseServiceImpl<DictionaryType> implements DictionaryTypeService {

    @Autowired
    private DictionaryDetailMapper dictionaryDetailMapper;

    @Override
    public void del(Long id) {
        //先删明细
        dictionaryDetailMapper.delByTypes_id(id);
        //再删除类型
        super.del(id);
    }

    @Override
    public void patchDel(List<Long> ids) {
        //先删明细
        dictionaryDetailMapper.patchDelByTypes_id(ids);
        //再删
        super.patchDel(ids);
    }
}
